<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<style>
  canvas {
    display: block;
    margin: 0 auto;
    border: 2px solid #aaa;
  }
</style>
<body>
  <canvas id="canvas" height="500px" width="500px">
    您的浏览器版本过低，请升级浏览器或者使用谷歌浏览器打开！
  </canvas>
  <!--
    clear
  -->
  <script>
     /** @type {HTMLCanvasElement} */
    const canvas = document.getElementById('canvas');
    const ctx = canvas.getContext('2d');
    
    const deg = Math.PI * 2 / 360
    
    let count = 1;

    const timer = setInterval(() => {
      count++
      ctx.beginPath();
      ctx.arc(250, 250, 200, -Math.PI / 2, count * deg - Math.PI / 2, false);
      ctx.lineWidth = 5;
      ctx.strokeStyle = '#f00'
      ctx.stroke();
      if (count === 360) {
        clearInterval(timer);
      }
    }, 5)
</script>
  </script>
</body>
</html>